<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <p>姓氏："{{ firstName }}"</p>
    <p>名字："{{ lastName }}"</p>
    <p>姓名："{{ fullName }}"</p>
    <p>姓名："{{ fullName }}"</p>
</div>


</body>
<script>
let app = new Vue({
    el: '#app',
    data: {
        firstName: 'Elon',
        lastName: 'Musk',
    },
    computed: {
        fullName: function () {
            // `this` 指向 vm 实例
            console.log("fullName 被执行了")
            return this.firstName + ' ' + this.lastName
        }
    }
})

</script>
</html>
